<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:fragment="header">
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">答疑平台</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a href="/">主页 <span class="sr-only">(current)</span></a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">问题平台 <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">常见问题库</a></li>
                            <li><a href="#">人工问题库</a></li>
                        </ul>
                    </li>
                </ul>
                <form class="navbar-form navbar-left">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="请输入问题描述">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
                <ul class="nav navbar-nav navbar-right">
                    <li th:if="${session.user == null}"><a th:href="@{'/login?backUrl='+${backUrl}}">登录</a></li>
                    <li th:if="${session.user != null}" class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                           aria-expanded="false"><span th:text="${session.user.getName()}"></span><span
                                class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a th:href="@{{url}(url=${session.userType==1?'/ask':'/admin'})}"><span
                                    th:text="${session.userType==1?'发布问题':''}"></span></a></li>
                            <li><a th:href="@{{url}(url=${session.userType==1?'/center':'/admin'})}"><span
                                    th:text="${session.userType==1?'个人中心':'管理后台'}"></span></a></li>
                            <li><a href="#">我的通知</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a th:href="@{'/logout?backUrl='+${backUrl}}">退出登录</a></li>
                        </ul>
                    </li>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
</div>
<div th:fragment="footer">
    <div class="footer">
        <div>Copyright © 2020 问答平台 · <a href="http://question.lanwang.online" target="_blank">赣ICP备18008511号</a> ·
            所有人: <a href="#">xybh</a> · All Rights Reserved
            Powered
        </div>
    </div>
</div>

<div th:fragment="admin_left">
    <div class="col-md-2 col-sm-2 col-lg-2 admin-left">
        <div>
            <img src="/img/logo.jpg" alt="" class="img-circle center-block" style="width: 80px; height: 80px">
            <span>
                        <div class="text-center" th:text="${user.name}"></div>
                        <div class="text-center" th:text="${user.title}"></div>
                    </span>
        </div>
        <div class="panel-group table-responsive classify" style="margin-top: 10px;" role="tablist">
            <div class="panel panel-primary leftMenu">
                <!-- 利用data-target指定要折叠的分组列表 -->
                <div class="panel-heading" id="collapseListGroupHeading1" data-toggle="collapse" data-target="#collapseListGroup">
                    <h4 class="panel-title">
                        <a href="/admin">个人信息</a>
                    </h4>
                </div>
            </div>
            <div class="panel panel-primary leftMenu">
                <!-- 利用data-target指定要折叠的分组列表 -->
                <div class="panel-heading" id="collapseListGroupHeading1" data-toggle="collapse" data-target="#collapseListGroup"
                     role="tab">
                    <h4 class="panel-title">
                        <a href="/FAQ">常见问题库</a>
                    </h4>
                </div>
            </div>
            <!--panel end-->
            <div class="panel panel-primary leftMenu">
                <!-- 利用data-target指定要折叠的分组列表 -->
                <div class="panel-heading" id="collapseListGroupHeading1" data-toggle="collapse"
                     data-target="#collapseListGroup1" role="tab">
                    <h4 class="panel-title">
                        学生管理
                        <span class="glyphicon glyphicon-chevron-down right"></span>
                    </h4>
                </div>
                <div id="collapseListGroup1" class="panel-collapse collapse" role="tabpanel"
                     aria-labelledby="collapseListGroupHeading2">
                    <ul class="list-group">
                        <li class="list-group-item">
                            <a href="/admin/student">全部班级</a>
                        </li>
                        <li class="list-group-item" th:each="class:${user.className}">
                            <a th:href="@{'/admin/student'(classId=${class})}" th:text="${class}"></a>
                        </li>
                    </ul>
                </div>
            </div>
<!--            <div class="panel panel-primary leftMenu">-->
<!--                &lt;!&ndash; 利用data-target指定要折叠的分组列表 &ndash;&gt;-->
<!--                <div class="panel-heading" id="collapseListGroupHeading1" data-toggle="collapse"-->
<!--                     data-target="#collapseListGroup2" role="tab">-->
<!--                    <h4 class="panel-title">-->
<!--                        教师管理-->
<!--                        <span class="glyphicon glyphicon-chevron-down right"></span>-->
<!--                    </h4>-->
<!--                </div>-->
<!--                <div id="collapseListGroup2" class="panel-collapse collapse" role="tabpanel"-->
<!--                     aria-labelledby="collapseListGroupHeading2">-->
<!--                    <ul class="list-group">-->
<!--                        <li class="list-group-item">-->
<!--                            <a href="">全部教师</a>-->
<!--                        </li>-->
<!--                        <li class="list-group-item">-->
<!--                            <a href="">语文</a>-->
<!--                        </li>-->
<!--                        <li class="list-group-item">-->
<!--                            <a href="">数学</a>-->
<!--                        </li>-->
<!--                        <li class="list-group-item">-->
<!--                            <a href="">英语</a>-->
<!--                        </li>-->
<!--                        <li class="list-group-item">-->
<!--                            <a href="">编程</a>-->
<!--                        </li>-->
<!--                    </ul>-->
<!--                </div>-->
<!--            </div>-->
            <!--panel end-->
            <div class="panel panel-primary leftMenu">
                <div class="panel-heading" id="collapseListGroupHeading2" data-toggle="collapse"
                     data-target="#collapseListGroup3" role="tab">
                    <h4 class="panel-title">
                        人工答疑
                    </h4>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>